export class dutyForm{
    constructor(data) {
        this.departmentInput = '';
        this.department = '';
        this.startOnduty = ''; /*开始时间*/
        this.endOnduty = ''; /*结束时间*/
        this.departmentNames = []; /*新增/编辑部门名称*/
        this.departmentIds = ''; /*新增/编辑部门名称id*/
        this.distributionEmail = 1;/*发送邮件状态*/
        this.haveDuty = 1;/*是否有人值班*/
        this.totalTime='';/*总时长*/

        if (data) {
            // 角色添加
            this.department = data.department;
            this.startOnduty = data.startOnduty;
            this.endOnduty = data.endOnduty;
            this.departmentNames = data.departmentNames;
            this.departmentIds = data.departmentIds;
            this.departmentInput = data.departmentInput;
            this.distributionEmail = data.distributionEmail;
            this.haveDuty = data.haveDuty;
            this.totalTime = data.totalTime;/*总时长*/
        }
    }
    rules() {
        return {
            department: [
                { required: true, message: '请选择部门', trigger: 'change' }
            ],
            startOnduty: [
                { required: true, message: '请选择开始时间', trigger: 'change' }
            ],
            endOnduty: [
                {  required: true, message: '请选择结束时间', trigger: 'change' }
            ],
        };
    }
}
